package com.example.demo.pattern.factory.general;

/**
 * 普通工厂类 接口  接口实现类  工厂类
 */
public class ShapeFactoryGeneral {

    public com.example.demo.pattern.factory.general.Shape getShape(String shapeType){
        if (shapeType == null) return null;
        if (shapeType.equalsIgnoreCase("circle")){
            return new Circle();
        }else if (shapeType.equalsIgnoreCase("rectangle")){
            return new Rectangle();
        }else if (shapeType.equalsIgnoreCase("square")){
            return new Square();
        }else{
            return null;
        }

    }
}
